coos.cstock = function(){};
coos.cstock.operationlog = function(formId)
{
	coos.$id("subButton").disabled = true;
	var form = coos.$id(formId);
	if(form["oplog.userName"].value.trim() == "")
	{
		alert("用户名不能为空，请填写后发表！");
		form["oplog.userName"].focus();
		coos.$id("subButton").disabled = false;
		return false;
	}
	coos.form.submit(formId);
};

coos.cstock.fundinfo = function(formId)
{
	coos.$id("subButton2").disabled = true;
	var form = coos.$id(formId);
	if(form["searchKey"].value.trim() == "")
	{
		alert("查询内容不能为空，请填写后发表！");
		form["searchKey"].focus();
		coos.$id("subButton2").disabled = false;
		return false;
	}
	coos.form.submit(formId);
};

coos.cstock.upload = function(formId)
{
	coos.$id("subButton").disabled = true;
	coos.$id("loading").style.display = "";
	var form = coos.$id(formId);
	if(form["upload"].value.trim() == "")
	{
		alert("请选择上传的文件！");
		form["upload"].focus();
		coos.$id("subButton").disabled = false;
		coos.$id("loading").style.display = "none";
		return false;
	}   
    if(form["upload"].value.toLowerCase().indexOf(".txt")==-1)
    {
      alert("您选择的文件格式不对!");
      coos.$id("subButton").disabled = false;
      coos.$id("loading").style.display = "none";  
      return false;
    }
    coos.form.submit(formId);
};

coos.cstock.upload.message = function(value)
{
    if(value.toLowerCase().indexOf(".txt")==-1)
    {
		alert("您选择的文件格式不对!");      
		return false;
    }
};

